UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j3bOAJzzoUdH0Ghpj6k1NlOD4I15+SBXF4TGQmEEc10=' 
WHERE 
  key_id = '2ec4ce7c7de0ec467704cba72d88d309696954f6028fd9e8b050db3dbd0aaf20' 
  AND (
    token = 'j3bOAJzzoUdH0Ghpj6k1NlOD4I15+SBXF4TGQmEEc10=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036