UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EPIqzbPpwNbOH5s2QtDkr68xp+m5jj/ePYdoVtuSsDM=' 
WHERE 
  key_id = '9294e4326745e833cbc931f1a090243f61570fc3ad46320fa0596703d287365a' 
  AND (
    token = 'EPIqzbPpwNbOH5s2QtDkr68xp+m5jj/ePYdoVtuSsDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029