UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WXKh7Ph7Mudyf6x9RYjX8e9a0vUk0brSJPeqh6NfFII='
WHERE
key_id = '69bf514cfcd2830d6c5acd0efd9cb369270dc26f57d225adf01e92a2cf24d078'
AND (
token = 'WXKh7Ph7Mudyf6x9RYjX8e9a0vUk0brSJPeqh6NfFII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)