UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TColgkGQyOu0obJj8MV/FLP0YQ1yl8MvbVuU4Bbt4k0='
WHERE
key_id = '08bf5348f4f0928a062e7c434fccf2e32c536cc1e7730c718e5a28b8d8fb7e9d'
AND (
token = 'TColgkGQyOu0obJj8MV/FLP0YQ1yl8MvbVuU4Bbt4k0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)