UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLQjyf2BipIiISgPoYouvI2nRr/TtcFaPJTecB1FlTs='
WHERE
key_id = 'b57dd87ff43692cefd53ca5139a9d853909e3ecc9a9ade146d3daa785e0ca271'
AND (
token = 'HLQjyf2BipIiISgPoYouvI2nRr/TtcFaPJTecB1FlTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)