UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9TmX9wZOw1JT04fezd3EAs/6WCewhJMGrZoaGe2pXPI='
WHERE
key_id = 'b9be47e4a6c303fcf961f0248ee3f756edfc3b334162dc293b7e700bbbbef67d'
AND (
token = '9TmX9wZOw1JT04fezd3EAs/6WCewhJMGrZoaGe2pXPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)