UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mvolcLLOUSZQKKXgeXhLBbwNgY+MoMN/9a2/gLrHHAg=' 
WHERE 
  key_id = '23e21039f244277f97a0f1750462e8d762fdd8aa69b6ce38e2fd7185f8eec9f9' 
  AND (
    token = 'mvolcLLOUSZQKKXgeXhLBbwNgY+MoMN/9a2/gLrHHAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030