UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fKCCGehXUIwIuUBAK2jPBJTBu1i4/USiml4wWWUuiX4=' 
WHERE 
  key_id = '007e5fcd210d074fccb1288ef5723c9718e7269a63f7eb892ceb0c0ec7fe30d5' 
  AND (
    token = 'fKCCGehXUIwIuUBAK2jPBJTBu1i4/USiml4wWWUuiX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034