UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z2HsKZXwEEuppThLvTqb+5MwIAWzbk5L7LXviivFmJM=' 
WHERE 
  key_id = '30ab4a6e8f8cf03565cb49560d12c9cbe1d98e439e2cb01ab3baa5426a6a988c' 
  AND (
    token = 'Z2HsKZXwEEuppThLvTqb+5MwIAWzbk5L7LXviivFmJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033