UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XshjocCvxZWks+a4lmSGBejhEXz7qgO3hflzoWQfOZ4='
WHERE
key_id = '7710acb18cb8738136546efc479f579c1d867952280473d9d90a933da9eda835'
AND (
token = 'XshjocCvxZWks+a4lmSGBejhEXz7qgO3hflzoWQfOZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)