UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oCWZdKMdWTnKwCVeV9ozc01+QtPyUfB8a2idADObrLQ=' 
WHERE 
  key_id = 'eed2d2f7c2731fdbb121da02cd5d927cc670faea245b7b311ad7c92e1e3bc9b4' 
  AND (
    token = 'oCWZdKMdWTnKwCVeV9ozc01+QtPyUfB8a2idADObrLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018