UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gaMCkY725kekgyMH9cbuQ33hb4qzP/W2Xu8g4DHOsPM=' 
WHERE 
  key_id = '130626dd1e51925fb380551e0aa8a0a6b244000a82c35e3eeb050f7e640d1c84' 
  AND (
    token = 'gaMCkY725kekgyMH9cbuQ33hb4qzP/W2Xu8g4DHOsPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037