UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HL8IbQWAAimnkhsXKrjyuW7HCL/FlEDZXO0q7Q2eR4I=' 
WHERE 
  key_id = 'e96a76e52fdb192887ebad180ca1951af1a68e03097c7d8419764c199786d20e' 
  AND (
    token = 'HL8IbQWAAimnkhsXKrjyuW7HCL/FlEDZXO0q7Q2eR4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020