UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/rFhkQFn1fWPh1oXtTE/+FoyEffEAaoMlPsuw2lPV7w='
WHERE
key_id = '1ce1b33e4041542666cc9c83f215e01dfa21e247fa4e86bb656978b98d9950b9'
AND (
token = '/rFhkQFn1fWPh1oXtTE/+FoyEffEAaoMlPsuw2lPV7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)