UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HVYCxy56nqR5vVqrrlIHOUNpNgD0fY/5rUgEwMLwlIw='
WHERE
key_id = '01ad24f4a585afe36e8fd137234baaba6a3515737f2b18d94dcc168a0d70606e'
AND (
token = 'HVYCxy56nqR5vVqrrlIHOUNpNgD0fY/5rUgEwMLwlIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)