UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2pJjNok5YW3PZG1DHFNz3vVnnDJe8UEcbEJ7o/s7wbA=' 
WHERE 
  key_id = '117ad41c514390eff3e626b11b4f5da7f062e6b600fc5d790903dc8e52bc323a' 
  AND (
    token = '2pJjNok5YW3PZG1DHFNz3vVnnDJe8UEcbEJ7o/s7wbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031