UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wFPOYzg5E/mrDM/1+W9278wkQCS5ABHTOkxZWHuYObo='
WHERE
key_id = 'a1736696a32052592e14ff237539863b3d4ec1a6c9ca3230de6cda4a9eb2d25e'
AND (
token = 'wFPOYzg5E/mrDM/1+W9278wkQCS5ABHTOkxZWHuYObo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)