UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4J/pjaUx1iATjvPyFfKPi5ljHswzljX4NskeizpH0E=' 
WHERE 
  key_id = 'f50f3af4a50504765fca99523145a100edad8196790f0cb111f1611116d8db45' 
  AND (
    token = 'Q4J/pjaUx1iATjvPyFfKPi5ljHswzljX4NskeizpH0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024