UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jFhBvbaMqTPilsyXBYRC50ITBBG4EvPrxzp36pns18I='
WHERE
key_id = 'a3f36bab39648d89ff791c4404640cd7c71b1164f235c4e4daf618dfba3694e4'
AND (
token = 'jFhBvbaMqTPilsyXBYRC50ITBBG4EvPrxzp36pns18I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)