UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bETKOnmFIGsSAmbf6lQRghqvLyti6ZikclSo8ZYd2IE='
WHERE
key_id = 'eabdbdfc13c2617e6beb42a6002718c71da4594e06eb3d490115a3be690751aa'
AND (
token = 'bETKOnmFIGsSAmbf6lQRghqvLyti6ZikclSo8ZYd2IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)