UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/QpIuXSNSI7RaUkdGyHugcC1q+rDjxkT7ZHFXkD79fA='
WHERE
key_id = '2bf768582ac7b6012f280de719f48edd85f5c11fdc3265c7a195ed8153e02c29'
AND (
token = '/QpIuXSNSI7RaUkdGyHugcC1q+rDjxkT7ZHFXkD79fA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)