UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fl2fEwwMHlaB/jZ8wjBYRCvFk0CLRUAff5HVJFiit/Y='
WHERE
key_id = 'c8ee16180e41536b9ae1126ae667d43072035993f54617404b72118e4164b1e2'
AND (
token = 'Fl2fEwwMHlaB/jZ8wjBYRCvFk0CLRUAff5HVJFiit/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)