UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qIpNXQG6MwQmrR9IBZ1lK4mA8I894Oi9ICicGzLorsI='
WHERE
key_id = '0848153c4f9aa7af49367f0684127ab28054d0d9b28579f8b9055e20d03e5e76'
AND (
token = 'qIpNXQG6MwQmrR9IBZ1lK4mA8I894Oi9ICicGzLorsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)