UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pchd/q7L9JKvmL17DY088JVLXfnVBZS5S+BvAz9F80Y='
WHERE
key_id = 'ca70f5f6c702159ea7175bfb67179e3ca538a3d5c610d3aacc8b53e9959f5f61'
AND (
token = 'Pchd/q7L9JKvmL17DY088JVLXfnVBZS5S+BvAz9F80Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)