UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GJZFmhLCqnYouPoUh51QH2Cc4SSbVoZyIvDTM5hmYUQ=' 
WHERE 
  key_id = '857c1aea0afa9efe0e25c3829d4a694611964b36db34375a6b28f4f237b59a4c' 
  AND (
    token = 'GJZFmhLCqnYouPoUh51QH2Cc4SSbVoZyIvDTM5hmYUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028