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