UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A3H/8QfmYKeFoWPGMtSa+7zvbNzoqbEZMUpwBJIyyhI='
WHERE
key_id = 'aeb62f550f65bdbb85325232e25ee20842e3cc71cd0c77282dadd9247e528c25'
AND (
token = 'A3H/8QfmYKeFoWPGMtSa+7zvbNzoqbEZMUpwBJIyyhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)