UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wcNPZ7ITievy/UjF0r7ubgZrH7mKPFpDDLDDLh8Dvj4='
WHERE
key_id = '8b638cb3371593fd57eb8f911a1d0c58a518b87c3b6bdbf023c0f76b15d0d6ae'
AND (
token = 'wcNPZ7ITievy/UjF0r7ubgZrH7mKPFpDDLDDLh8Dvj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)