UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mMTinqwLpkrmkdab6dkHKLlPWWImE8uYDe2lhwURqlQ='
WHERE
key_id = '52e349c35db593a2e6962a76ca873db81e680a13a105b9fefc766dcd10889a80'
AND (
token = 'mMTinqwLpkrmkdab6dkHKLlPWWImE8uYDe2lhwURqlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)