UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qyCr6Dicr++KtC8dZLMIsSFN1sAg+OkGuI7bLhwMYSE='
WHERE
key_id = '50de6fd853693269af33c857e4f7ef2c7a4fba432c232294cf8caffc2c878f3f'
AND (
token = 'qyCr6Dicr++KtC8dZLMIsSFN1sAg+OkGuI7bLhwMYSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)