UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e8MtJcmAWcklXoOyP88PUppfutgLBjhB3uM/4XEu9WI=' 
WHERE 
  key_id = 'af4eae6c06d22d60d9bc690adbf30428b0f72df4a969223be5cd9a01f1e4baec' 
  AND (
    token = 'e8MtJcmAWcklXoOyP88PUppfutgLBjhB3uM/4XEu9WI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020