UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+YWuCIekJTNsC6xCFusDQ2I8nZt3QWGuP6ouS4T2Yq4='
WHERE
key_id = 'be11d066768e6615f9fc8c18f45723f31adbb12a1ed06fdc7481e2b3965dce08'
AND (
token = '+YWuCIekJTNsC6xCFusDQ2I8nZt3QWGuP6ouS4T2Yq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)