UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/jSMNyYdDQ/FqfwvkVGUjmA42F9ASbwUYZZnZf9kOdY=' 
WHERE 
  key_id = '5104824794392e7a3aa90aeb18489b916e0aa882f732c891cb9efd2ea901ec35' 
  AND (
    token = '/jSMNyYdDQ/FqfwvkVGUjmA42F9ASbwUYZZnZf9kOdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027