UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8v8WMcqtE8yGPcWmN9JNPNbIf65bLHWREYUWkmoQ5HU='
WHERE
key_id = '62c7b1f1c2a4153b61132f6279a317c795b220e35d1fbd887c8c3032e1793d41'
AND (
token = '8v8WMcqtE8yGPcWmN9JNPNbIf65bLHWREYUWkmoQ5HU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)