UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'McSGfsfQQsndlyyWRCyEdlUFTA7hTCR4h4fHWP3Fkqk=' 
WHERE 
  key_id = '0d2363468cd5cb6efedadb4148f55fd171ce64069deb5ba449badd95b848b6f0' 
  AND (
    token = 'McSGfsfQQsndlyyWRCyEdlUFTA7hTCR4h4fHWP3Fkqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048