UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mOzWP17PFrROf3S52PikW8uwargJRbyEXyDRTLoSd5g='
WHERE
key_id = '9a5938b7b63d58e0b5dcd62cf20d070bcb75c090808889106cb332ed0d79360c'
AND (
token = 'mOzWP17PFrROf3S52PikW8uwargJRbyEXyDRTLoSd5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)