UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qv2u4wkGmx4vrljDwadKxm/szSP1gstrRnAtRbecMH0='
WHERE
key_id = '7bc335aa711bf7e47eed2c7c94beb2d1dd565268192479f2351562d983da252c'
AND (
token = 'qv2u4wkGmx4vrljDwadKxm/szSP1gstrRnAtRbecMH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)