UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AZVE9F9QYlUDkvhpEXD7J4ubo6xE3xef/BSjJqLyVBY='
WHERE
key_id = '900171e5f924f358768e5027d4e56c5991578c9a016e059b87e6d0691ab2ed3f'
AND (
token = 'AZVE9F9QYlUDkvhpEXD7J4ubo6xE3xef/BSjJqLyVBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)