UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o+Tly2QNZnSotHY4lEwlwmBoTf0NvhPrwTT3ZmVEcjY=' 
WHERE 
  key_id = 'a6b123199f44f5feaa8bb33fab2d0ad91e1f3a20efe98e6ba456f5c1e8110e60' 
  AND (
    token = 'o+Tly2QNZnSotHY4lEwlwmBoTf0NvhPrwTT3ZmVEcjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035