UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x7qHPeoD//iz3jMrvkOOclb9KfYGPACILuK1M2tJDVE='
WHERE
key_id = '94adecd992bebe298b81a17915fbc4df26b40d03f3258789201a8f714588198d'
AND (
token = 'x7qHPeoD//iz3jMrvkOOclb9KfYGPACILuK1M2tJDVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)