UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TgaonB4VqfcmlljCF/VKN8EB6rXCjScXaCqLSw/ClDg='
WHERE
key_id = 'd4438b5c0b52c82f41ea5a09a116ce6a426f3315cb5c271988d0f7741fbc6e9b'
AND (
token = 'TgaonB4VqfcmlljCF/VKN8EB6rXCjScXaCqLSw/ClDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)