UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c+YerEaZ/HFAGHsno7v2XWFc7Me2lCQYDvSduWiGORQ=' 
WHERE 
  key_id = '30ead80dff0c7d78a4b78f1bb61ec8838d6fb5edbf3147b185471d486b42de58' 
  AND (
    token = 'c+YerEaZ/HFAGHsno7v2XWFc7Me2lCQYDvSduWiGORQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047