UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ssVMjKlJUUXfDw+ehpXqDUkJBi/sWOM4k2d4gzycEWI='
WHERE
key_id = '6c3f14682518541ea30681932e3774a8794fd8a82eaf12e210f1ab5b682dbd1c'
AND (
token = 'ssVMjKlJUUXfDw+ehpXqDUkJBi/sWOM4k2d4gzycEWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)