UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qo2F2dEXIfV4KcUpDrmRGCMxxPXgzeVXGjSjgZnso2w='
WHERE
key_id = '2bd76f198821fee36b67215a7aa9ea6f9c9c165f0afdb16208297b270ca0af49'
AND (
token = 'Qo2F2dEXIfV4KcUpDrmRGCMxxPXgzeVXGjSjgZnso2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)